interface PIC {
    void kaishi();
    void tingzhi();
}
class xianka implements PIC{
    public void kaishi(){
        System.out.println("显卡启动");
    }
    public void tingzhi(){
        System.out.println("显卡停止");
    }
}
class wangka implements PIC{
    public void kaishi(){
        System.out.println("网卡启动");
    }
    public void tingzhi(){
        System.out.println("网卡停止");
    }
}
class shengka implements PIC{
    public void kaishi(){
        System.out.println("声卡启动");
    }
    public void tingzhi(){
        System.out.println("声卡停止");
    }
}
class Computer{
    private PIC[] slots;
    public Computer(int numSlots) {
        slots = new PIC[numSlots];
    }
    public void addCard(PIC card, int slotIndex) {
        if (slotIndex >= 0 && slotIndex < slots.length) {
            slots[slotIndex] = card;
        }
    }
    public void startComputer() {
        System.out.println("启动计算机");
        for (PIC slots : slots) {
            if (slots != null) {
                slots.kaishi();
            }
        }
        System.out.println("计算机启动成功");
            }
    public void stopComputer() {
        System.out.println("关闭计算机");
        for (PIC slots : slots) {
            if (slots != null) {
                slots.tingzhi();
            }
        }
        System.out.println("计算机关闭成功");
    }
}
